//成功响应拦截器

import { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common";
import { Observable, map } from "rxjs";



export class WsServiceResponseInterceptor implements NestInterceptor {
    intercept(context: ExecutionContext,
              next: CallHandler):
        Observable<any> | Promise<Observable<any>> {


        return next.handle().pipe(map(data => {
           return   {
                code: 0,
                data: data,
                msg: 'success'
            }
        })) 
    }
}
